import request from 'src/axios'

/**
 * @description 分页查询库区信息列表
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const pageWarehouseArea = (params: object) => {
  return request.get('/wms/warehouseArea/page', { params })
}

/**
 * @description 查询所有库区信息
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const listWarehouseArea = (params?: object) => {
  return request.get('/wms/warehouseArea/list', { params })
}

/**
 * @description 查看库区信息
 * @param { String } id 主键
 * @returns Promise
 */
export const viewWarehouseArea = (id: string) => {
  return request.get('/wms/warehouseArea', { params: { id } })
}

/**
 * @description 新增库区信息
 * @param { Object } data 新增数据
 * @returns Promise
 */
export const saveWarehouseArea = (data: object) => {
  return request.post('/wms/warehouseArea', data)
}

/**
 * @description 修改库区信息
 * @param { Object } data 修改数据
 * @returns Promise
 */
export const updateWarehouseArea = (data: object) => {
  return request.put('/wms/warehouseArea', data)
}

/**
 * @description 删除库区信息
 * @param { Array<string> } ids 主键数组
 * @returns Promise
 */
export const deleteWarehouseArea = (ids: Array<string>) => {
  return request.delete('/wms/warehouseArea', { data: ids })
}

/**
 * @description 启用库区信息
 * @param { String } id 主键
 * @returns Promise
 */
 export const enableWarehouseArea = (id: string) => {
  return request.put('/wms/warehouseArea/enable', { id })
}

/**
 * @description 禁用库区信息
 * @param { String } id 主键
 * @returns Promise
 */
export const disableWarehouseArea = (id: string) => {
  return request.put('/wms/warehouseArea/disable', { id })
}
